package corej.course.basic;

public class TestString {
    public static void main(String[] args) {
        String s1 = "123";
        String s2 = new String("123");
        String s3 = "123";
        String s4 = new String("123");

        s2 = s2.intern();
        s4 = s4.intern();

        /*
           * System.out.println(s1==s3); System.out.println(s2==s4);
           */
        System.out.println(s1 == s2);
        System.out.println(s2 == s4);

        String s = "A";
        /*
           * s=s+"B"+"C"+"D"+"E"; System.out.println(s);
           */

        StringBuffer sb = new StringBuffer(s);
        sb.append("B");
        sb.append("C");
        sb.append("D");
        sb.append("E");
        s = sb.toString();
        System.out.println(s);
    }
}